//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    internal class ThemeableLineStyle : IOfficeXmlSerializableAs
    {
        private LineProperties _ln;
        private StyleMatrixReference _lnRef;

        #region IOfficeXmlSerializableAs Members

        public void ReadXmlAs(string name, ReadContext context)
        {
            using (var c = context.Read(name))
            {
                _ln = c.ReadElement<LineProperties>();
                _lnRef = c.ReadElementAs<StyleMatrixReference>("lnRef");
            }
        }

        public void WriteXmlAs(string name, WriteContext context)
        {
            using (var c = context.Write(name))
            {
                c.WriteElement(_ln);
                c.WriteElementAs(_lnRef, "lnRef");
            }
        }

        #endregion
    }
}